<template>
  <div>
    <div>
      <button @click="isshow = !isshow">切换</button>
      <!-- <transition name="fade">
        <div class="box" v-if="isshow"></div
      > </transition> -->
      <transition
        enter-active-class="animate__animated animate__fadeOutUp"
        leave-active-class="animate__animated animate__fadeOut"
      >
        <div class="box" v-if="isshow"></div>
      </transition>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      isshow: true,
    };
  },
};
</script>

<style lang="less" scoped>
.box {
  width: 200px;
  height: 200px;
  background-color: pink;
  margin: 100px auto;
}
// .fade-enter {
//   opacity: 0;
// }

// .fade-enter-active {
//   transition: all 1s;
// }
// .fade-enter-to {
//   opacity: 1;
// }

// .fade-leave {
//   opacity: 1;
// }
// .fade-leave-active {
//   transition: all 1s;
// }
// .fade-leave-to {
//   opacity: 0;
// }
</style>